#pragma once
#include "Common.h"
#include "SpanList.hpp"

class CentralCache
{
private:
	SpanList _spanLists[NFREELIST];

	static CentralCache _sInst;

	CentralCache(){}

	CentralCache(const CentralCache&) = delete;

public:
	static CentralCache* GetInstance()
	{
		return &_sInst;
	}

	void ReleaseListToSpans(void* start, size_t size);

	size_t FetchRangeObj(void*& start, void*& end, size_t batchNum, size_t size);

	Span* GetOneSpan(SpanList& spanList, size_t size);
};

